<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function fun(){
            alert("无参函数被调用")
        }


        //函数只有被调用才会执行
        // fun();

        function fun1(a,b){
            alert("有参函数a=>"+a+"b=>"+b);
        }

        // fun1(10,20);

        //定义有返回值的函数
        function sum(num1,num2){
            var newVar = num1 + num2;
            return newVar;
        }

        // alert(sum(1,23))

        var fun2 = function(){
            alert("无参函数");
        }

        var fun3 = function(a,b){
            alert(a+" "+b);
        }

        var fun4 = function(num1,num2){
            return num1+num2;
        }


    </script>
</head>
<body>

</body>
</html>